package com.bo.ioc.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/prop")
@RestController
public class PropertiesController {
    @Value("${my.key1}")
    public Integer key1;
    @Value("${my.key2}")
    public String key2;
    @Value("${spring.datasource.url}")
    public String url;
    @Value("${String.str1}")
    public String str1;
    @Value("${String.str2}")
    public String str2;
    @Value("${String.str3}")
    public String str3;
    @RequestMapping("/run1")
    public void run1(){
        System.out.println(key1);
        System.out.println(key2);
        System.out.println(url);
    }
    @RequestMapping("/run2")
    public String run2(){
        return key1 + " " + key2 + " " + url;
    }
    @RequestMapping("/run3")
    public void run3(){
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);
    }
}
